package cn.edu.shiep.aurora.gunwar;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import cn.edu.shiep.aurora.gunwar.sensor.MediaPlay;

public class MainActivity extends Activity {
	int i=8;
	private ImageButton btn_startgame, btn_help;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		MediaPlay.getInstance(this).playBGM(this);
		btn_startgame = (ImageButton) findViewById(R.id.imgbtnstartgame);
		btn_startgame.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				MediaPlay.getInstance(MainActivity.this).playMusicShootAGun(
						MainActivity.this);
				btn_startgame.setBackgroundResource(R.drawable.startgamepress);
				startActivity(new Intent(MainActivity.this, World.class));
				MainActivity.this.finish();

			}

		});
		btn_help = (ImageButton) findViewById(R.id.gamehelp);
		btn_help.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				MediaPlay.getInstance(MainActivity.this).playMusicShootAGun(
						MainActivity.this);
				btn_help.setBackgroundResource(R.drawable.gamehelppress);
				startActivity(new Intent(MainActivity.this, Introduction.class));

			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}
